package com.example.IOCtry.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class BeanConfig {
    @Bean
    public String name(){
        return "zhangsan";
    }
    @Bean
    public String name2(){
        return "wangwu";
    }
    //@Primary
    @Bean
    public UserInfo UserInfo1(String name2){
        UserInfo userInfo=new UserInfo();
        userInfo.setName(name2);
        return  userInfo;
    }
    @Bean
    public UserInfo userInfo2(){
        UserInfo userInfo=new UserInfo();
        userInfo.setId(2);
        userInfo.setAge(22);
        userInfo.setName("lclyr");
        return  userInfo;
    }

}
